package cn.ex.basic.util;

import lombok.Data;

/**
 * @Author: ZeWangmu
 * @Date: 2022/06/06/20:05
 * @Description: 修改，删除，新增返回的结果集对象
 */
@Data
public class AjaxResult {

    private Boolean success = true;
    private String message = "操作成功！！!";
    private Object resultObj;

    public static AjaxResult me(){
        return new AjaxResult();
    }

    /**
     * 链式编程
     * @param success
     * @return
     */
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    /**
     * 返回自定义的结果集字段
     * @param resultObj
     * @return
     */
    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
